var Curb65Assistant = Class.create(AbstractModule, {


setupWidgets: function() {

		//About
		this.controller.setupWidget(Mojo.Menu.appMenu, {
			omitDefaultItems: true
		}, {
			visible: true,
			items: [
      		Mojo.Menu.editItem,
			{ label: "Disclaimer", command: "do-disclaimer" },					
				{ label: "License", command: "do-license" },
				{ label: "Help", command: "do-help" }
			]
		});

this.help = true;

  

	//amt limit not working?

this.toggleModel = {
      confCHK: true
			};

	this.toggleModel = {
		ureaCHK: false
			};
	this.toggleModel = {
			respCHK: false
			};
			
	this.toggleModel = {
			bpCHK: false
			};						
	this.toggleModel = {
			ageCHK: false
			};
			

			
	this.controller.setupWidget("ageCHK", {
			modelProperty: "ageCHK"
		}, this.toggleModel);

	this.controller.setupWidget("bpCHK", {
			modelProperty: "bpCHK"
		}, this.toggleModel);

	this.controller.setupWidget("respCHK", {
			modelProperty: "respCHK"
		}, this.toggleModel);

	this.controller.setupWidget("ureaCHK", {
			modelProperty: "ureaCHK"
		}, this.toggleModel);
		
	this.controller.setupWidget("confHK", {
			modelProperty: "confCHK"
		}, this.toggleModel);
	
},



	calculate: function() {
	var result = curb65calc(this.toggleModel.confCHK,this.toggleModel.ureaCHK,this.toggleModel.respCHK,this.toggleModel.bpCHK,this.toggleModel.ageCHK);
 
	return "The CURB-65 score is " + result.curb65score +"<br /> Risk of dying from pneumonia is " + result.mortality + "<br /> Recommendation: " + result.action;
	}
});





